package jdk.collection;

import java.util.LinkedList;
import java.util.List;

public class LinkedListDemo {

    public static void main(String[] args) {
        List<String> list = new LinkedList<String>();
        list.add("大卫");
        list.add("小明");
        list.add("小红");
        System.out.println(list);

        list.add(1, "大罗");


        list.add("m");
        list.remove(1);

        list.get(0);
        list.remove("abc");

        LinkedList<String> linkedList = (LinkedList)list;
        //删除并返回第一个元素
        linkedList.poll();
        //返回第一个元素
        linkedList.peek();
    }
}
